package Server;

// A class to encapsulate order records
public class OrderRec {
  private int bookRef;
  private int custRef;
  private String charge;
  private String when;
  private String status;
  private String toHand;

  public OrderRec(int nBRef, int nCRef, String nChg, String nWhen,
      String nStatus, String nToHand) {
    bookRef = nBRef;      custRef = nCRef;    charge = nChg;
    when = nWhen;         status = nStatus;   toHand = nToHand;
  }

  int    getBookRef()  { return bookRef; }
  int    getCustRef()  { return custRef; }
  String getCharge()   { return charge; }
  String getWhen()     { return when; }
  String getStatus()   { return status; }
  String getToHand()   {return toHand; }

  //will need some set methods if records are to be editable.

  public String toString() {
    return String.format("%04d\t%04d\t%s\t%s\t%s\t%s\n",
      bookRef, custRef, charge, when, status, toHand);
  }
}

